package com.bang.daybreak.security.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * <p>
 *     自定义加解密规则.
 * </p>
 *
 * @version 1.0
 * @author: wdj
 * @date: 2019/8/18 0018 下午 17:03
 */
@Slf4j
public class MyPasswordEncoder implements PasswordEncoder {

    @Override
    public String encode(CharSequence charSequence) {
        log.info("{}", charSequence);
        return charSequence.toString();
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return s.equals(charSequence.toString());
    }
}
